
public class demo1 {
    private double income;
    private double expenses;

    public demo1() {
        this.income = 0;
        this.expenses = 0;
    }

    public void recordIncome(double amount) {
        this.income += amount;
        System.out.println("Income recorded: $" + amount);
    }

    public void recordExpense(double amount) {
        this.expenses += amount;
        System.out.println("Expense recorded: $" + amount);
    }

    public double getBalance() {
        return this.income - this.expenses;
    }

    public static void main(String[] args) {
        demo1 tracker = new demo1();
        tracker.recordIncome(1000);
        tracker.recordExpense(200);
        System.out.println("Current balance: $" + tracker.getBalance());
    }
}